package com.sgb.auction.entity;

import android.text.TextUtils;
import com.swgk.core.util.DateUtils;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Time:2021/11/23
 * AUTHOR:F_Q
 * Description:
 */
public class AuctionListEntity implements Serializable {

    /*{
        "no": "1462984971135356928",
            "name": "测试拍卖（短期结束）",
            "version": 0,
            "highestPrice": 500000,
            "unitName": "千克",
            "num": 100,
            "region": "北京北京市东城区",
            "image": "https://jyb-zhaocai.oss-cn-hangzhou.aliyuncs.com/temp/4a5c5be8-09ad-43b3-b903-2c78165c5ca4.jpg",
            "state": 2,
            "auctionStartTime": "1637636400000",
            "auctionEndTime": "1637663400000"
    }*/
    private String no;
    private String name;
    private int version;
    private String highestPrice;
    private String unitName;
    private String num;
    private String region;
    private String image;
    private double lat;
    private double lng;
    private int state;
    private String auctionStartTime;
    private String auctionEndTime;
    private int userFocusFlag;

    public int getUserFocusFlag() {
        return userFocusFlag;
    }

    public void setUserFocusFlag(int userFocusFlag) {
        this.userFocusFlag = userFocusFlag;
    }

    public double getLat() {
        return lat;
    }

    public void setLng(double lng) {
        this.lng = lng;
    }

    public double getLng() {
        return lng;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getHighestPrice() {
        if (!TextUtils.isEmpty(highestPrice)){
            BigDecimal big = new BigDecimal(highestPrice);
            big = big.stripTrailingZeros();
            return big.toPlainString();
        }else {
            return "";
        }
    }

    public void setHighestPrice(String highestPrice) {
        this.highestPrice = highestPrice;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public String getNum() {
        if (!TextUtils.isEmpty(num)){
            BigDecimal big = new BigDecimal(num);
            big = big.stripTrailingZeros();
            return big.toPlainString();
        }else {
            return "";
        }
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getAuctionStartTime() {
        if (!TextUtils.isEmpty(auctionStartTime)){
            String timestamp = DateUtils.timestampToDateSecond(Long.parseLong(auctionStartTime));
            return timestamp.substring(2,timestamp.length());
        }else {
            return "";
        }
    }

    public void setAuctionStartTime(String auctionStartTime) {
        this.auctionStartTime = auctionStartTime;
    }

    public String getAuctionEndTime() {
        if (!TextUtils.isEmpty(auctionEndTime)){
            String auctionEndTimes = DateUtils.timestampToDateSecond(Long.parseLong(auctionEndTime));
            return auctionEndTimes.substring(2,auctionEndTimes.length());
        }else {
            return "";
        }
    }

    public void setAuctionEndTime(String auctionEndTime) {
        this.auctionEndTime = auctionEndTime;
    }
}
